export default {
  data() {
    return {
      // 表单数据
      formData: {
        phone_num: ''
      },

      // 表单验证
      formDataRules: {
        phone_num: [{
          required: true,
          message: '请输入客服电话',
          trigger: 'blur'
        }, ]
      },
    }
  },

  //进入页面加载
  mounted: function () {
    var that = this;
    //在缓存中获取值
    that.user_name = sessionStorage.getItem("user_name");
    that.user_id = sessionStorage.getItem("user_id");
    that.token = sessionStorage.getItem("access-token");
    if ((!that.token) || (!that.user_id) || (!that.user_name)) {
      that.$router.push('/login');
    }
  },

  methods: {

    /**
     * 保存员工数据
     */
    save: function (formName) {
      let that = this;
      this.$refs[formName].validate((valid) => {
        if (valid) {

          that.$http.post(that.adminApi.api_url + "/Operator/operatoradd", formData, {
            emulateJSON: true
          }).then(
            function (res) {
              var data = res.body;

            });
        } else {
          return false;
        }
      });
    },
  }
}